package com.rmfyzxfw.caseprocess.job;

import com.rmfyzxfw.caseprocess.service.CaseProcessService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @description:
 * @Author: GYW  742926306@qq.com
 * @Date: 2024/8/26 17:25
 */
@Component
@RequiredArgsConstructor
@Slf4j
public class CaseProcessJob {
    private final CaseProcessService caseProcessService;

    // TODO 定时任务待配置  多个线程 1.根据类型  2.根据法院
    @Scheduled(cron = "6 0 3 * * ? ")
    public void caseProcessZX(){
        log.info("案件定时任务开始执行 {}", LocalDateTime.now());
        long start = System.currentTimeMillis();
        caseProcessService.caseProcessZX();
        log.info("案件定时任务结束执行 {}", LocalDateTime.now());
        log.info("执行定时任务耗时 {} 毫秒", System.currentTimeMillis() - start);
    }

}